//
//  UIView+MBLayout.m
//  SocketRocket
//
//  Created by July Cattery on 17/4/20.
//  Copyright © 2017年 loovee. All rights reserved.
//

#import "UIView+MBLayout.h"

@implementation UIView (MBLayout)

//设置下划线
- (void)setLineWithColor:(UIColor *)color
{
    //下划线
    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, self.frame.size.height - 2, self.frame.size.width, 2)];
    line.backgroundColor = color;
    [self addSubview:line];
}

- (void)setCornerWithRadius:(CGFloat)radius {
    self.layer.cornerRadius = radius;
    self.layer.masksToBounds = YES;
}
- (void)setCornerWithRadius:(CGFloat)radius borderWidth:(CGFloat)width borderColor:(UIColor *)color {
//    self.layer.cornerRadius = radius;
//    self.layer.borderColor = color.CGColor;
//    self.layer.borderWidth = width;
//    self.layer.masksToBounds = YES;
    
    //下划线
    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, self.frame.size.height - 2, self.frame.size.width, 2)];
    line.backgroundColor = WB_HEX_COLOR(0x333333);
    [self addSubview:line];
}

//设置正方形
- (void)setSquareBorder
{
    [self.layer setBorderWidth:1.0];
    self.layer.cornerRadius = 0.f;
    self.layer.borderColor = WB_HEX_COLOR(0x000000).CGColor;
}




@end
